package com.edgegateway.common.config;

import com.edgegateway.common.pk.IdWorker;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @AUTHOR Doooxu
 * @DATE 2023/1/6
 * @DESCRIBE
 */
@Configuration
@ConfigurationProperties(prefix = "pk")
@Data
public class CustomerConfig {
    private Long workerId;
    private Long datacenterId;
    @Bean
    public IdWorker createIdWorker() {
        IdWorker worker = new IdWorker(workerId, datacenterId);
        return worker;
    }
}
